<%--
 管理员对用户的删除操作
  User: gyy
  Date: 2021-04-08
  Time: 11:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html lang="en">

<head>
    <c:import url="commons.jsp"></c:import>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>SB Admin</title>
    <!-- Bootstrap core CSS-->
    <link href="${pd}/statics/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <!-- Custom fonts for this template-->
    <link href="${pd}/statics/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <!-- Page level plugin CSS-->
    <link href="${pd}/statics/vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet">
    <!-- Custom styles for this template-->
    <link href="${pd}/statics/css/sb-admin.css" rel="stylesheet">
  <script src="${pd}/statics/js/jquery.js"></script>
        <script>
            function deleteAlert(){
                var flag=confirm("确认删除吗？");
                if(flag){
                    $("#btn").submit();
                }else {
                    return;
                }
            }
        </script>
<script>
        //全选
        function selectUserAll(obj) {
            console.log(obj);
            if (obj.checked == true) {
                //打开全选，下面的所有选择框都祖选择
                $("[name='ids']").prop("checked",true);
            } else {
                //关闭全选
                $("[name='ids']").prop("checked",false);
            }
        }
    </script>

</head>

<body class="fixed-nav sticky-footer bg-dark" id="page-top">

<%--<c:import url="adminNav.jsp"></c:import>--%>
<div class="content-wrapper">
    <div class="container-fluid">
        <!-- 用户信息-->
        <div class="card mb-3">
            <div class="card-header">
                <i class="fa fa-table"></i> 课程信息</div>

            <div class="card-body">
                <div class="table-responsive">
                  <form action="adminDelect.action" method="post" >
                    <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
                        <thead>
                        <tr>
                            <th> <input type="checkbox" onclick="selectUserAll(this)"></th>
                            <th>课程序号</th>
                            <th>课程名称</th>
                            <th>教练编号</th>
                            <th>俱乐部编号</th>
                            <th>课程费用</th>
                            <th>上课日期时间</th>
                            <th>上课人数</th>
                            <th>课程时间</th>
                            <th>课程图片</th>
                        </tr>
                        </thead>

                        <tbody>
                        <c:forEach var="course" items="${courseList}">
                            <tr>
                                <td><input name="ids" type="checkbox" value="${course.cId}" /></td>
                                <td>${course.cId}</td>
                                <td>${course.cName}</td>
                                <td>${course.coId}</td>
                                <td>${course.clId}</td>
                                <td>${course.cMoney}</td>
                                <td>${course.cDate}</td>
                                <td>${course.cNumber}</td>
                                <td>${course.coTime}</td>
                                <td>${course.cImg}</td>

                                <td> <input class="btn btn-yellow btn-w-md" onclick="javascript:location.href='adminDelect.action?ids=${user.lId}'"
                                            value="预约" type="button" /></td>
                            </tr>
                        </c:forEach>
                        </tbody>

                    </table>

                    <div style="text-align: center">
                            <input class="btn btn-yellow btn-w-md" value="删除" type="submit" onclick="deleteAlert()"   id="btn"/>
                    </div>
                  </form>
                </div>
                </div>
            </div>
        </div>
    </div>


    <!-- Bootstrap core JavaScript-->
<%--    <script src="statics/vendor/jquery/jquery.min.js"></script>--%>
    <script src="${pd}/statics/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
    <!-- Core plugin JavaScript-->
    <script src="${pd}/statics/vendor/jquery-easing/jquery.easing.min.js"></script>
    <!-- Page level plugin JavaScript-->
<%--    <script src="statics/vendor/datatables/jquery.dataTables.js"></script>--%>
    <script src="${pd}/statics/vendor/datatables/dataTables.bootstrap4.js"></script>
    <!-- Custom scripts for all pages-->
    <script src="${pd}/statics/js/sb-admin.min.js"></script>
    <!-- Custom scripts for this page-->
    <script src="${pd}/statics/js/sb-admin-datatables.min.js"></script>
</div>
</body>

</html>
